﻿using System;
using System.ComponentModel;
using System.Windows.Input;
using uTrade.Core;

namespace uTrade.ViewModels
{
    internal class TestReportViewModel : INotifyPropertyChanged
    {
        private static Strategy TestStrategy;

        //定义命令属性
        public ICommand SelectionChangedCommand { get; set; }

        public TestReportViewModel()
        {
            //初始化selectionChangedCommand 事件
            SelectionChangedCommand = new DelegateCommand(SelectionChanged, CanselectionChangedCommand);
        }

        public static void LoadResult(Strategy strategy)
        {
            TestStrategy = strategy;
        }

        //命令的方法
        public void SelectionChanged(object param)
        {
            //MessageBox.Show("OK");
            Console.WriteLine("OK");
        }

        //启用命令
        public bool CanselectionChangedCommand(object param)
        {
            return true;
        }

        #region INotifyPropertyChanged属性

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion INotifyPropertyChanged属性

        #region 属性更改方法

        private void RaisePropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion 属性更改方法
    }
}